﻿#region Using namespaces

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

#endregion

namespace BOL.Apps.GeneNetworkBrowser.Controls
{
    public partial class TissueFilter : GroupBox
    {
        public TissueTypes TissueTypes
        {
            get
            {
                TissueTypes tissueTypes = TissueTypes.None;

                if (_cbTissueAll.IsChecked.Value)
                {
                    tissueTypes |= TissueTypes.Bladder;
                    tissueTypes |= TissueTypes.Blood;
                    tissueTypes |= TissueTypes.Bone;
                    tissueTypes |= TissueTypes.Bone_Marrow;
                    tissueTypes |= TissueTypes.Brain;
                    tissueTypes |= TissueTypes.Cervix;
                    tissueTypes |= TissueTypes.Colon;
                    tissueTypes |= TissueTypes.Eye;
                    tissueTypes |= TissueTypes.Heart;
                    tissueTypes |= TissueTypes.Kidney;
                    tissueTypes |= TissueTypes.Larynx;
                    tissueTypes |= TissueTypes.Liver;
                    tissueTypes |= TissueTypes.Lung;
                    tissueTypes |= TissueTypes.Lymph;
                    tissueTypes |= TissueTypes.Mammary;
                    tissueTypes |= TissueTypes.Muscle;
                    tissueTypes |= TissueTypes.Ovary;
                    tissueTypes |= TissueTypes.Pancreas;
                    tissueTypes |= TissueTypes.Peripheral_Nervous_System;
                    tissueTypes |= TissueTypes.Placenta;
                    tissueTypes |= TissueTypes.Prostate;
                    tissueTypes |= TissueTypes.Skin;
                    tissueTypes |= TissueTypes.Small_Intestine;
                    tissueTypes |= TissueTypes.Soft_Tissue;
                    tissueTypes |= TissueTypes.Spleen;
                    tissueTypes |= TissueTypes.Stomach;
                    tissueTypes |= TissueTypes.Testis;
                    tissueTypes |= TissueTypes.Thymus;
                    tissueTypes |= TissueTypes.Tongue;
                    tissueTypes |= TissueTypes.Uterus;
                }
                else
                {

                    if (_cbTissueBladder.IsChecked.Value)
                        tissueTypes |= TissueTypes.Bladder;
                    if (_cbTissueBlood.IsChecked.Value)
                        tissueTypes |= TissueTypes.Blood;
                    if (_cbTissueBone.IsChecked.Value)
                        tissueTypes |= TissueTypes.Bone;
                    if (_cbTissueBoneMarrow.IsChecked.Value)
                        tissueTypes |= TissueTypes.Bone_Marrow;
                    if (_cbTissueBrain.IsChecked.Value)
                        tissueTypes |= TissueTypes.Brain;
                    if (_cbTissueCervix.IsChecked.Value)
                        tissueTypes |= TissueTypes.Cervix;
                    if (_cbTissueColon.IsChecked.Value)
                        tissueTypes |= TissueTypes.Colon;
                    if (_cbTissueEye.IsChecked.Value)
                        tissueTypes |= TissueTypes.Eye;
                    if (_cbTissueHeart.IsChecked.Value)
                        tissueTypes |= TissueTypes.Heart;
                    if (_cbTissueKidney.IsChecked.Value)
                        tissueTypes |= TissueTypes.Kidney;
                    if (_cbTissueLarynx.IsChecked.Value)
                        tissueTypes |= TissueTypes.Larynx;
                    if (_cbTissueLiver.IsChecked.Value)
                        tissueTypes |= TissueTypes.Liver;
                    if (_cbTissueLung.IsChecked.Value)
                        tissueTypes |= TissueTypes.Lung;
                    if (_cbTissueLymph.IsChecked.Value)
                        tissueTypes |= TissueTypes.Lymph;
                    if (_cbTissueMammary.IsChecked.Value)
                        tissueTypes |= TissueTypes.Mammary;
                    if (_cbTissueMuscle.IsChecked.Value)
                        tissueTypes |= TissueTypes.Muscle;
                    if (_cbTissueOvary.IsChecked.Value)
                        tissueTypes |= TissueTypes.Ovary;
                    if (_cbTissuePancreas.IsChecked.Value)
                        tissueTypes |= TissueTypes.Pancreas;
                    if (_cbTissuePeripheralNervousSystem.IsChecked.Value)
                        tissueTypes |= TissueTypes.Peripheral_Nervous_System;
                    if (_cbTissuePlacenta.IsChecked.Value)
                        tissueTypes |= TissueTypes.Placenta;
                    if (_cbTissueProstate.IsChecked.Value)
                        tissueTypes |= TissueTypes.Prostate;
                    if (_cbTissueSkin.IsChecked.Value)
                        tissueTypes |= TissueTypes.Skin;
                    if (_cbTissueSmallIntestine.IsChecked.Value)
                        tissueTypes |= TissueTypes.Small_Intestine;
                    if (_cbTissueSoftTissue.IsChecked.Value)
                        tissueTypes |= TissueTypes.Soft_Tissue;
                    if (_cbTissueSpleen.IsChecked.Value)
                        tissueTypes |= TissueTypes.Spleen;
                    if (_cbTissueStomach.IsChecked.Value)
                        tissueTypes |= TissueTypes.Stomach;
                    if (_cbTissueTestis.IsChecked.Value)
                        tissueTypes |= TissueTypes.Testis;
                    if (_cbTissueThymus.IsChecked.Value)
                        tissueTypes |= TissueTypes.Thymus;
                    if (_cbTissueTongue.IsChecked.Value)
                        tissueTypes |= TissueTypes.Tongue;
                    if (_cbTissueUterus.IsChecked.Value)
                        tissueTypes |= TissueTypes.Uterus;
                }

                return tissueTypes;
            }
        }

        public TissueFilter()
        {
            InitializeComponent();
        }
    }
}
